package edu.nanyang.struts;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import edu.nanyang.domain.Goods;
import edu.nanyang.domain.User;
import edu.nanyang.hibernate.ManageGoods;
import edu.nanyang.hibernate.ManageUser;

public class ManageGoodsAction extends ActionSupport {
	private ManageGoods managegoods;
	private List<Goods> goods;
	private int goodsid;
	private Goods goods1;
	
	
	
	public Goods getGoods1() {
		return goods1;
	}

	public void setGoods1(Goods goods1) {
		this.goods1 = goods1;
	}

	public int getGoodsid() {
		return goodsid;
	}

	public void setGoodsid(int goodsid) {
		this.goodsid = goodsid;
	}


	public ManageGoods getManagegoods() {
		return managegoods;
	}

	public void setManagegoods(ManageGoods managegoods) {
		this.managegoods = managegoods;
	}

	public List<Goods> getGoods() {
		return goods;
	}

	public String selectgoods(){
		this.goods=managegoods.selectgoods();
		
		return SUCCESS;
			
	}


	public String deletegoods(){
		managegoods.deletegoods(goodsid);
		
		return SUCCESS;
			
	}
	public String modifygoods() {
		
		goods1= managegoods.selectgoods(goodsid);
		return SUCCESS;
	}
	
	public String modifygoods1() {


		
		System.out.print("goods1.id=="+goods1.getId());
		System.out.print("goods1.title=="+goods1.getTitle());
		
		managegoods.updateGoods(goods1);
		return SUCCESS;
	}
}

